package com.automannn.seataSamples.account.mapper;

import com.automannn.seataSamples.account.entity.AccountPO;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author automannn
 * @Date 2022/3/24
 */
public interface AccountMapper extends BaseMapper<AccountPO> {

    /**
     * 减少账户余额
     * @param userId 账户所属用户
     * @param amount 减少余额
     * @return 影响行数
     */
    int decreaseAccount(@Param("userId") String userId,@RequestParam("amount") Double amount);
}
